package scala.p1

import scala.collection._

/**
 * Created by IntelliJ IDEA.
 * User: denny
 * Date: Jun 7, 2010
 * Time: 12:50:13 PM
 * To change this template use File | Settings | File Templates.
 */

object A1{
  object cfor{
    def map[B](a:(Int)=>B) = assert(false,"unsupp")
  }

  for(i <- cfor) yield i

  def code{
//    val now = new Date
//    val df = getDateInstance(LONG, Locale.FRANCE)
//    println(df format now)
    val l = List(1,2,3)
    val m = Map() ++ (l map (o => (o,o*o)))
    println(m+ " "+m.getClass)
    val m1 = (new mutable.HashMap[Int,Int] /: l){ case (h,i) => h.put(i, i*i); h }
    println(m1)

  }

  def mm(a:String):String = "aaa"
  //def mm(a:String):Int = 20
      /*
  trait A{
     val xx = 5
  }
  trait B{
    self : A =>
     abstract override val xx = "qwe"
  }
  class AB extends A with B  */

trait AbstractT2 {
  println("In AbstractT2:")
  val value: Int
  val inverse = 1.0/value
  println("AbstractT2: value = "+value+", inverse = "+inverse)
}

val c2c = new {
  // Only initializations are allowed in pre-init. blocks.
  // println("In c2c:")
  val value = 10
} with AbstractT2

println("c2c.value = "+c2c.value+", inverse = "+c2c.inverse)
}